﻿// 动态检索数据combo
Ext.define('Kwan.ex.RemotCombo', {
    extend: 'Ext.form.field.ComboBox',
    alias: 'widget.Kwan.ex.RemotCombo',
    minChars: 0,
    dataUrl: '', // 请求绑定数据的地址
    forceSelection: true,
    triggerAction: 'all',
    modelFields: [],
    mode: 'local',
    queryMode: 'local',
    forceSelection: true,
    triggerAction: 'all',
    typeAhead: true,
    isPagging: true,
    initComponent: function () {
        var me = this;
        if (this.isPagging == true)
            this.pageSize = 10;
        this.store = Ext.create('Ext.data.Store', {
            fields: this.modelFields,
            pageSize: 10,
            // autoLoad : true,
            proxy: {
                type: 'ajax',
                url: this.dataUrl,
                reader: { type: 'json', root: 'data.data', totalProperty: 'data.total' }
            }
        });
        this.listConfig = {
            loadingText: 'Searching...',
            emptyText: 'No matching posts found.',
            getInnerTpl: function () {
                return me.innerTpl;
            }
        };
        this.callParent(arguments);
    }
});